Forum:Modding Hacknet - Part 1 - Hello World
Disclaimer DISCLAIMER: THERE IS NO OFFICIAL WAY TO MOD HACKNET AS OF NOW. THE MODDING YOU WILL BE DOING INVOLVES GOING INTO THE GAME'S FILES AND CHANGING THEM TO CREATE A MOD. PLEASE BACK-UP YOUR GAME IF YOU HAVE NOT DONE SO. Starting Off Now that that's out of the way, welcome to modding Hacknet! We're going to create a simple "Hello World" Program. To begin, let's create our first computer! First, you have to go into the files. Navigate to the folder in which you installed Hacknet. If you installed Hacknet via Steam, navigate to the steam library, right click on Hacknet, click "Properties" and click "Local Files" in the menu that just appeared at the top. Then click "Browse Local Files" In the files Once you're inside the files, navigate to "Content". You're in! Now, we have to create our first computer. To do this, create a new folder titled: "My Own Computer". Inside this folder, we are going to create a file titled: "MyVeryFirstComputer.xml" The reason for this is that Hacknet creates computers using XML or The Extensible Markup Language. If you don't what XML is, you should try a couple of [http://www.w3schools.com/xml/ w3schools] tutorials to learn a bit of what it is. My first Computer Create a new .txt file titled "MyVeryFirstComputer.txt" inside your My Own Computer folder, using your preferred editor. In the txt file, type in: Breaking it down So, what was that? First, let's start with the tag (Tags are numbers and letters enclosed in <> characters, telling the computer how to display a webpage. I'd recommend looking at the w3schools tutorial for a better explanation) . The Hello world! Once that's done, rename HelloWorld.txt to: HelloWorld.html. Next, we need to add to our program: '''''' Breaking it down So what did we do? First, we made a simple HTML program that says "Hello World". The tag says that the file is an html file, and when it has the .html ending, it is telling the computer: "Yep, this is an html file". The tagtells the computer that we want to be able to write to the file to show the user our "Hello World" Text. For the other file, we told the computer, under the Computer tag, that in the game, you can connect to the computer you made using the ip 48.222.1.865 (Not a real IP). The addWebServer part means that once you connect, you will access the HelloWorld.html file, and view it. Finishing up To finish it up, rename "MyVeryFirstComputer.txt" to "MyVeryFirstComputer.xml". Before you launch the game however, and test it out, we need to make sure that the computer will load. Go to Content/Computers/BootLoadList.txt and scroll down to the bottom of the text file. Add to it: #MyOwnComputer Content/My Own Computer/MyVeryFirstComputer.xml Once that's done, launch Hacknet, and start a new game. The reason for this is that Hacknet loads all computers when you start a new game, and does not check to make sure any more computers are added after you start a game, which is why whenever you test a mod, you have to start a game. All Done! Congratulations! You should have your first Computer made! Great job! In the [[Modding Hacknet - Part 2 - Adding Security|next]] tutorial, we'll learn how to secure our computer! Great! So, what was the stuff I just typed in? When you start a new game, it checks for the list of computers it should load. You added the location for the computer you made, and you can now access it, by copying and pasting the ip in hacknet using the connect command, once you get past the tutorial. One more thing If you're annoyed by the starting text everytime you launch the game, there's a simple solution. To remove the "hi my name is bit" part, go to Content/BitSpeech.txt, and remove everything except for one letter. For the System boot part, go to Content/OSXBoot.txt and remove everything except for one letter. (WARNING: IF YOU LEAVE NOTHING IN BITSPEECH.TXT OR OSXBOOT.TXT, YOUR GAME WILL NOT LOAD PROPERLY)=